<!DOCTYPE html>
<%@ page import="java.util.ArrayList, domain.file.FileDetails, constants.Constants" %>
<%
	String userName="";
	if(request.getSession().getAttribute("name")!=null) {
		userName=request.getSession().getAttribute("name").toString();		
	}
	ArrayList<FileDetails> allScenarioList = new ArrayList<FileDetails>();
	if(request.getSession().getAttribute(Constants.SESSION_ALL_SCENARIO_LIST)!=null){
		allScenarioList = (ArrayList<FileDetails>) request.getSession().getAttribute(Constants.SESSION_ALL_SCENARIO_LIST);
	}
	ArrayList<FileDetails> userScenarioList = new ArrayList<FileDetails>();
	if(request.getSession().getAttribute(Constants.SESSION_USER_SCENARIO_LIST)!=null){
		userScenarioList = (ArrayList<FileDetails>) request.getSession().getAttribute(Constants.SESSION_USER_SCENARIO_LIST);
	}
%>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Select Scenarios</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="../css/bootstrap.css" rel="stylesheet">
    <link href="../css/bootstrap-responsive.css" rel="stylesheet">
     <link href="../css/docs.css" rel="stylesheet">

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    
    
    
    <style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
	  
	  
	
    </style>
   

    
   
  </head>

  <body>

    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
        <a class="brand" href="#">DairyVIP Project</a>
          <div class="nav-collapse collapse">
            <p class="navbar-text pull-right">
              Logged in as <a href="#" class="navbar-link"><%= userName %></a>
            </p>
            <ul class="nav">
              <li><a href="index.jsp">Home</a></li>
     		  <li><a href="../jsp/acknowledgements_contro.jsp">Acknowledgements/Contributors</a></li>
              <li class="active"><a href="#">My DairyVIP</a></li>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    
    
    
  <div class="container-fluid">
      <div class="row-fluid">
        <div class="span3">
          <div class="well sidebar-nav">
            <ul class="nav nav-list">
            <li class="nav-header">Sidebar</li>
              <li ><a href="dataset.jsp">Select Scenarios</a></li>
            <li class="nav-header">Sidebar</li>
              <li class="active"><a href="#" >Create/Delete Scenarios</a></li>
              

            </ul>
          </div><!--/.well -->
        </div><!--/span-->
        <div class="span8">
          <div class="hero-unit">
            <img src="../images/new-header2.jpg" alt="bg3"  class="img-polaroid" />
          </div>
          
          <div class="row-fluid">
          
            <div class="span6">
           
               <form name="create">
    <legend>Create/Clone Data Scenario </legend>
   <label>Select Scenario</label>
    <select>
						<% for(int i = 0;i< allScenarioList.size();i++)   
						{ %> <option value ="<%= allScenarioList.get(i).getFileNo() %>">  
						<%=(String)allScenarioList.get(i).getFileName() %></option>  
						<%} %>
				</select>
    
    <label>New Name of Scenario</label>
    <input type="text" placeholder="Type something..." name="newname"/>
   <label>Description of Scenario</label>
    <input type="text" placeholder="Type something..." name="description"/>
   <br>
   <input class="btn" type="button" onclick="check(this.form)" value="Create" />
    <input class="btn" type="reset" value="Cancel" />
    </form>
            
            </div><!--/span-->
            <div class="span6">
             
              <form name="register">
    <legend>Delete an Existing Scenario </legend>
   <label>Select Scenario</label>
    <select>
						<% for(int i = 0;i< userScenarioList.size();i++)   
						{ %> <option value ="<%= userScenarioList.get(i).getFileNo() %>">  
						<%=(String)userScenarioList.get(i).getFileName() %></option>  
						<%} %>
				</select>
    
    <br>
 
 <input class="btn" type="button" onclick="check2(this.form)" value="Delete Selected Scenario" /> 
    </form>
            </div><!--/span-->
            
          
             
            
<script language="javascript">
		function check(form)/*function to create a new scenario*/
		{
			page = "adddeleteds" + ".jsp";
	
				alert("New Scenario created");/*displays error message*/
				window.self.location.href = page;
		
			return true;
		}
		
		function check2(form)/*function to check userid & password*/
		{
				alert("Scenario is deleted");
				page = "adddeleteds" + ".jsp";
				window.self.location.href = page;
				return true;
		
		}
		
	</script>
	
           
            
      
          </div><!--/row-->
        </div><!--/span-->
      </div><!--/row-->

      <hr>


    
      <footer class="footer">
       <%@ include file="../inc/footer.html" %>
      </footer>

    </div><!--/.fluid-container-->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    
    
  <script type="text/javascript" src="js/jquery.js"></script>
  <script src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/jquery.cycle.all.min.js"></script>
<script type="text/javascript" src="js/jquery.color.js"></script>

  </body>
</html>
